<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<link href="${pageContext.request.contextPath}/static/style/diary.css" rel="stylesheet">

<style>
	th{
		text-align: center;
	}
	
	.table {
		margin-left:110px;
	}
	.pager{
		margin-left:140px;
		padding-left: 140px;
	}
	
</style>

<script type="text/javascript">
function newsDelete()
{
	if(confirm("注意：您要删除这个日志吗?。\r           确定继续删除?"))
	{
		return true;
	}
	
	return false;
}
</script>

<table class="table"> 
	<thead >
		<tr >
		 	<th>发布日期</th>
		 	<th>标题</th>
		 	<th>操作</th>
		</tr> 
	</thead>
	<c:forEach var="diary" items="${diaryList }">
		 <thead>   
		 	 <tr>      
				 <th>
				 	『<fmt:formatDate value="${diary.releaseDate }" type="date" pattern="yyyy-MM-dd"/>』
					
				</th>      
				 <th><a href="${pageContext.request.contextPath }/diary/diaryId/${diary.diaryId }">${diary.title }</a></th>
				 <th>
					 <button class="btn btn-mini btn-info" type="button" onclick="javascript:window.location.href='${pageContext.request.contextPath}/background/toedit/diaryId/${diary.diaryId}'">修改</button>&nbsp;
					 <a href="${pageContext.request.contextPath}/background/delete/diaryId/${diary.diaryId}" onclick="return del();"><button class="btn btn-mini btn-danger" type="button" onclick="newsDelete()">删除</button></a>
				 </th>    
			 </tr> 
		</thead>  
		
	</c:forEach>
	
	</table>

<div>
	<nav>
	  <ul class="pager">
	    ${pageCode }
	  </ul>
	</nav>
 </div>